package net.tensor.skynet.api.controller.user

import net.tensor.skynet.api.service.user.UserServiceImpl
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.web.bind.annotation.*

@RestController
@RequestMapping("/user/queryAll")
class UserQueryAllController {

    @Autowired
    private lateinit var userService: UserServiceImpl

    @PostMapping
    fun invoke(@RequestBody param:Map<String,Any>):Any{
        return userService.queryList(param["collectionName"].toString())
    }

    @GetMapping("/{name}")
    fun invokeGet(@PathVariable(name = "name") name:String):Any{
        return userService.queryListGet(name)
    }
}